"""
@File    :   single_meta_class.py
@Time    :   2024/02/06 08:54:26
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   单例模式的元类
"""


class SingleMetaClass(type):
    """单例模式的元类"""

    _instances = {}

    def __call__(cls, *args: any, **kwds: any) -> any:
        if cls not in cls._instances:
            cls._instances[cls] = super().__call__(*args, **kwds)
        return cls._instances[cls]
